<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@page import="fr.cephb.locustree.LTServlet"%>
<%@page import="fr.cephb.locustree.Track"%>
<%!
private static final String COLORS[]={
		"AliceBlue",
		"AntiqueWhite",
		"Aqua",
		"Aquamarine",
		"Azure",
		"Beige",
		"Bisque",
		"Black",
		"BlanchedAlmond",
		"Blue",
		"BlueViolet",
		"Brown",
		"BurlyWood",
		"CadetBlue",
		"Chartreuse",
		"Chocolate",
		"Coral",
		"CornflowerBlue",
		"Cornsilk",
		"Crimson",
		"Cyan",
		"DarkBlue",
		"DarkCyan",
		"DarkGoldenRod",
		"DarkGray",
		"DarkGreen",
		"DarkKhaki",
		"DarkMagenta",
		"DarkOliveGreen",
		"Darkorange",
		"DarkOrchid",
		"DarkRed",
		"DarkSalmon",
		"DarkSeaGreen",
		"DarkSlateBlue",
		"DarkSlateGray",
		"DarkTurquoise",
		"DarkViolet",
		"DeepPink",
		"DeepSkyBlue",
		"DimGray",
		"DodgerBlue",
		"FireBrick",
		"FloralWhite",
		"ForestGreen",
		"Fuchsia",
		"Gainsboro",
		"GhostWhite",
		"Gold",
		"GoldenRod",
		"Gray",
		"Green",
		"GreenYellow",
		"HoneyDew",
		"HotPink",
		"IndianRed",
		"Indigo",
		"Ivory",
		"Khaki",
		"Lavender",
		"LavenderBlush",
		"LawnGreen",
		"LemonChiffon",
		"LightBlue",
		"LightCoral",
		"LightCyan",
		"LightGoldenRodYellow",
		"LightGrey",
		"LightGreen",
		"LightPink",
		"LightSalmon",
		"LightSeaGreen",
		"LightSkyBlue",
		"LightSlateGray",
		"LightSteelBlue",
		"LightYellow",
		"Lime",
		"LimeGreen",
		"Linen",
		"Magenta",
		"Maroon",
		"MediumAquaMarine",
		"MediumBlue",
		"MediumOrchid",
		"MediumPurple",
		"MediumSeaGreen",
		"MediumSlateBlue",
		"MediumSpringGreen",
		"MediumTurquoise",
		"MediumVioletRed",
		"MidnightBlue",
		"MintCream",
		"MistyRose",
		"Moccasin",
		"NavajoWhite",
		"Navy",
		"OldLace",
		"Olive",
		"OliveDrab",
		"Orange",
		"OrangeRed",
		"Orchid",
		"PaleGoldenRod",
		"PaleGreen",
		"PaleTurquoise",
		"PaleVioletRed",
		"PapayaWhip",
		"PeachPuff",
		"Peru",
		"Pink",
		"Plum",
		"PowderBlue",
		"Purple",
		"Red",
		"RosyBrown",
		"RoyalBlue",
		"SaddleBrown",
		"Salmon",
		"SandyBrown",
		"SeaGreen",
		"SeaShell",
		"Sienna",
		"Silver",
		"SkyBlue",
		"SlateBlue",
		"SlateGray",
		"Snow",
		"SpringGreen",
		"SteelBlue",
		"Tan",
		"Teal",
		"Thistle",
		"Tomato",
		"Turquoise",
		"Violet",
		"Wheat",
		"White",
		"WhiteSmoke",
		"Yellow",
		"YellowGreen"
	};
%>

<% 

Track track= (Track)request.getAttribute("track");
if(track==null) throw new ServletException("track missing");
LTServlet.User user= (LTServlet.User)request.getSession(false).getAttribute("user");
if(user==null) throw new ServletException("user missing");
LTServlet.TrackChoice pref= user.getTrackPrefs().get(track.getId());
if(pref==null) pref=new LTServlet.TrackChoice();

%>

<fieldset>
<legend>${track.name}</legend>
${track.description}<br/>
<label for="select_track_${track.id}">Display:</label>
<select id="select_track_${track.id}" name="displayTrack[${track.id}]">
<option value="">display</option>
<option value="hide">hide</option>
</select>

<%--
<label for="fill" style="width:100px; float: left; text-align:right;">Fill:</label>
<select name="fill[${track.id}]" id="fill">
	<% for(String css: COLORS) {
	out.append("<option style=\'background-color:"+css.toLowerCase()+";\' "+
			(css.equalsIgnoreCase(pref.getFill())?"selected='true'":"")+
		">").
		append(css).
		append("</options>");
	 }  %>
</select><br/>

<label for="stroke" style="width:100px; float: left; text-align:right;">Stroke:</label>
<select name="stroke[${track.id}]" id="stroke">
	<% for(String css: COLORS) {
	out.append("<option style=\'color:"+css.toLowerCase()+";\' "+
		(css.equalsIgnoreCase(pref.getStroke())?"selected='true'":"")+
		">").
		append(css).
		append("</options>");
	 }  %>
</select><br/>
<label for="strokeWidth" style="width:100px; float: left; text-align:right;">Pen Size:</label>
<select name="strokeWidth[${track.id}]" id="strokeWidth">
	<% for(int i=0;i< 10;++i) {
	out.append("<option "+
			(i==pref.getStrokeWidth()?"selected='true'":"")+
			">").append(String.valueOf(i)).append("</options>");
	 }  %>
</select>
 --%>
</fieldset>